<?php
namespace app\common\model;
use think\Model;

class Featured extends BaseModel   //model层 数据添加到数据库
{
//根据推荐位类型获取推荐位数据
public function getFeaturedsByType($type){
	$data = [
	    'type' => $type,
		'status' => ['neq', -1],
	
	];
	$order = ['id'=>'desc'];
	// var_dump($data);
	return $this->where($data)->order($order)->paginate(2);
	
	}

public function getAdsByType($type){
	
	  $data = [
	      'type' => $type,
		  'status' => 1,
	  
	  ];
	  
	  $order = [
	      'listorder' => 'desc',
		  'update_time' => 'desc',
	  
	  ];
	
	  return $this->where($data)->order($order)->select();
	
	}








}